Skip to content

feat(mcp): query_records says truncated: true on a capped page, and the stdio door counts its total - #35185

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-35138-capped
Nov 18, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-35138-capped

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Refs #35138 (item capped)
Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:MCP 的 query_records 在一页被行数上限截断时多答一个 truncated: true;stdio 通道的 total 改为真实计数,不再拿本页行数冒充总数。
  • 为什么改:模型会把被截断的一页当成全集去求和、排名;托管端已有这个提示,开源 MCP 门此前没有(mcp: the result members the hosted ask tools add over the framework tools are either moved into the framework or stated as hosted-only, one by one #35138 的 capped 一项)。
  • 风险与回滚:只加字段(仅为真时出现),不删不改既有字段;stdio 分页读多一次 count。回滚 = revert 本 PR。
  • 先看:packages/mcp/src/mcp-http-tools.ts(servedQueryPage / queryPageProbeFits 与 query_records 处理器);packages/mcp/src/stdio-data-bridge.ts(query 末尾的计数);packages/mcp/src/query-records-truncated.test.ts。
  • 两分钟验证:pnpm --filter @objectstack/mcp exec vitest run src/query-records-truncated.test.ts,预期 11 条全绿。
  • 需要你做的:无,席位落地。

What changes

  • query_records (packages/mcp/src/mcp-http-tools.ts, this handler only) asks the bridge for one row more than the page. When that row comes back, the tool serves the page and adds truncated: true. The member is present only when true: a page holding every matching row, exactly limit rows included, answers as before. Where the bridge answers hasMore, it is restated from the probe, because the door counted it against the widened read.
  • The data door's read window refuses, never clamps, a read over OS_DATA_MAX_PAGE_SIZE or past OS_DATA_QUERY_ROW_BUDGET (packages/types/src/query-read-limits.ts planQueryReadWindow). Where the probe row would cross either, the page is read as asked and the door's counted hasMore decides truncated. Without this, a host with OS_DATA_MAX_PAGE_SIZE equal to the MCP page cap would refuse every full-page query_records.
  • The tool description now says the answer is one page and that a truncated page must not be summed, counted or ranked as if whole: read on with offset, or use aggregate_records where it is offered.
  • The stdio bridge's query (packages/mcp/src/stdio-data-bridge.ts) answered { object, records, total: records.length } with no hasMore (origin/main 7d8dcf693a, line 1378), so a capped stdio page claimed to be the whole set. The HTTP door goes through callData('query') (packages/runtime/src/action-execution.ts 858-867) into findData, which counts (packages/metadata-protocol/src/protocol-data-crud.ts 761-822). The stdio bridge now answers the same page facts: a paged read is counted under the same where, as the caller (engine.count(object, { where }, { context })). total is the match total and hasMore says whether rows remain. If the count fails, total is left out and hasMore answers from the page alone, as the data door's $count=false arm does. An unpaged read keeps total: records.length and hasMore: false, and no count runs.
  • The type stays local to packages/mcp. The spec types only the source block of query_records' result (packages/spec/src/ai/object-query-source.zod.ts), not the result itself, so nothing enters packages/spec (ADR-0149 M1).
  • No existing member is renamed or removed. aggregate_records and its totalGroups / truncated are untouched.

Tests

  • New packages/mcp/src/query-records-truncated.test.ts drives query_records through registerObjectTools over an in-memory MCP client on both doors. The HTTP door uses a bridge answering findData's counted page facts. The stdio door uses createStdioDataBridge over a stand-in engine. Pins per door: a capped page answers truncated: true with the page only, and the probe asks for limit + 1. A page of exactly limit rows answers no truncated. The last page of a paged read is not capped. Under OS_DATA_MAX_PAGE_SIZE equal to the page, no probe is sent and hasMore decides. Pins on the stdio bridge itself: a capped page answers the counted total, not the page length. A failing count states no total. An unpaged read runs no count.
  • Two preservation pins now expect the probe row the bridge receives: mcp-http-tools.unknown-argument-keys.test.ts (limit 3 becomes 4) and mcp-server-runtime.http.test.ts (5 becomes 6). The page served is unchanged.
  • stdio-data-bridge.stored-metadata-body.test.ts: the engine-read census names the new count(object) site. It is a number, never a row, counted under the where that the stored-body and hash refusals already judged.
Ablations (scripts/ablation-replace.mjs, each restored to the HEAD blob, git diff HEAD empty)
  • A1, the truncated member deleted from servedQueryPage: 4 failed, 7 passed (both doors' capped and read-window pins).
  • A2, records.length > page mutated to >=: 2 failed, 9 passed (both doors' exact-limit pins).
  • A3, the stdio bridge back to total: records.length: 5 failed, 6 passed (the stdio door's capped, exact-limit, last-page and read-window pins, and the counted-total pin).

Acceptance notes

  • findData falls back to a page-local total when engine.count throws (packages/metadata-protocol/src/protocol-data-crud.ts 804-808). That is a total the HTTP door did not count. It is outside this PR's file surface, so it is noted here and not changed.
  • On the stdio door, every paged bridge.query now runs one engine.count. That includes delete_records' selection read, which goes through the same bridge member.

Verification

All readings below were taken at head d85434872f.

Local runs
  • pnpm --filter '@objectstack/mcp^...' build (under the verify lock): VERDICT command-exit 0.
  • pnpm --filter @objectstack/mcp test: Test Files 72 passed (72), Tests 1281 passed (1281).
  • pnpm --filter @objectstack/mcp typecheck: tsc clean; check:test-typecheck OK, 6 files / 53 errors / 8 pinned signatures held, unchanged.
  • dispatch-gates --commands: 68 derived families. 67 exited 0. pnpm check:dual-build-cjs-loads exited 3, PREREQUISITE NOT MET (it reads every package's dist/, and only the mcp dependency closure is built here). NOT MEASURED locally; CI's Lint and Repo Gates runs it. --ran reconciliation: 68 derived, 67 run, 1 NOT-MEASURED, 0 UNRUN.
  • overlap-check.mjs: clean against origin/main, 0 open PR heads share a file.

Generated by Claude Code

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 12 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 910306b632bfeb4a6d12a03d6ab489fd1a3d6128 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 7fc680e827bba18c18f8f791885323e72ca8a55f — the merge of head c56f66f4efc04d4e00411e35f0ff6e02463e962a into base 910306b632bfeb4a6d12a03d6ab489fd1a3d6128, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 7fc680e827bba18c18f8f791885323e72ca8a55f && git checkout 7fc680e827bba18c18f8f791885323e72ca8a55f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 910306b632bfeb4a6d12a03d6ab489fd1a3d6128 c56f66f4efc04d4e00411e35f0ff6e02463e962a && git checkout -B drift-repro 910306b632bfeb4a6d12a03d6ab489fd1a3d6128 && git merge --no-ff c56f66f4efc04d4e00411e35f0ff6e02463e962a

node scripts/docs-audit/affected-docs.mjs --json 910306b632bfeb4a6d12a03d6ab489fd1a3d6128

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi

Contract review brief handed to the isolated reviewer (TIER_DEFAULT, declaration face), posted beside its record:

Contract review brief — PR #35185 @ c56f66f4efc04d4e00411e35f0ff6e02463e962a (card #35138, PR 1 "capped")

You review at TIER_DEFAULT. Render ONE ## Contract review record on this head (shape: node scripts/pm/record-recognisers.mjs --template --face declaration) with a PASS or FAIL verdict.

  • Face: the Clause-②: yes (widening) declaration (claim 6975089907, amendment 6975318215). Confirm from the committed file list that no packages/spec/src/** or governed path is touched; if one is, stop and say so.
  • Read: card mcp: the result members the hosted ask tools add over the framework tools are either moved into the framework or stated as hosted-only, one by one #35138 and its comments (W0 decisions 6975318215, os-dev report 6976907593), the PR body, the full diff against its merge-base, the changeset, and the head's check-runs. Code outside the diff is read at origin/main only.
  • ① Judge query_records after the diff on both doors: the present-only truncated member from a page+1 probe, the fallback to the counted hasMore where the read window would refuse page+1 (is the fallback sound, and does any full page now get refused?), the stdio bridge's counted total (read as the caller, omitted when the count fails), the description text, what the built entry of @objectstack/mcp reaches; anything removed, renamed or narrowed; the SQL push-down check (one extra count read on stdio).
  • ② Changeset level and the line-initial Clause-② / Metadata-protocol lines in PR body and changeset; changeset prose against the diff. Note the PR body cites readings at the pre-move head d85434872f.
  • ③ Every dev deviation (three pre-existing test files changed; one NOT-MEASURED gate; a helper move after an overlap with feat(mcp): query_records and get_record name the fields field-level security withheld from the caller #35179) and the out-of-scope note answered or escalated.
  • Implemented-by: claude/issue-35138-capped · Reviewed-by: session_01JQwxbYRqkDAGuse5Wqbohi.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi

Contract review

Served-tier: TIER_DEFAULT
Head-sha: c56f66f4efc04d4e00411e35f0ff6e02463e962a
Local-runs: none

Inputs: brief 6976945886; card #35138 (body and all 10 comments, among them claim 6975089907, W0 decisions 6975318215 and os-dev report 6976907593); PR #35185 (body and comments); the full diff against merge-base 7d8dcf693a (3 commits, 7 files, +292/−11); the changeset; and the check-runs on this head. Code outside the diff was read at origin/main only.

Face: the committed file list is one changeset and six files under packages/mcp/src/. It touches no packages/spec/src/** path and no governed path. record-recognisers.mjs --paths decides no face from the paths and defers to the changeset's Clause-②: line, which carries yes (widening). So this is the declaration face at TIER_DEFAULT, with no ④.

① Derived judgments

  • CI on this head is still running. 50 check-runs: 23 success, 16 skipped, 11 in progress, 0 failure. Still running: Test Core (7 of 10 shards), Type Check · consumer gates, Lint · docs & code guards, Lint · CI, release & engine gates and Lint · scoped · query-options erasure. Complete and green: Build Core, Type Check · workspace, Type Check · source gates, Type Check · debt ledger, Lint · repo & tooling gates (which carries the NOT-MEASURED check:dual-build-cjs-loads), Lint · ESLint, Check Changeset, Governed Surface Queue Guard, PR-body guards, Check PR Size, Dogfood Regression Gate, Test UI and Live E2E UI. I judge on what is complete. The seat must see the 11 in-progress runs finish green on this head before landing. The 2 failures on the earlier head d85434872f are its aggregate jobs, which ran after 19 cancelled runs when the head moved. They are not readings of this head.
  • The probe and truncated on query_records: widened, right. The handler asks the bridge for page + 1 rows. servedQueryPage serves the first page rows and adds truncated: true only when the extra row came back. The member is absent otherwise, never false, so a page holding every matching row (exactly limit rows included) answers the same keys as before. Where the bridge answers hasMore, it is restated from the probe: true exactly when more rows came back than the page holds. That is right: the door counted hasMore against the widened read. total is untouched, and on the HTTP door it is a count that does not depend on the limit (findData, protocol-data-crud.ts around line 790). A result that is not a plain object with a records array is passed through unchanged. That matches the withDelegationNotice posture, which still runs after it.
  • The fallback where the read window would refuse the probe: sound, and no full page is newly refused. queryPageProbeFits mirrors the two refusals in planQueryReadWindow (packages/types/src/query-read-limits.ts at origin/main): a limit over maxPageSize, and offset plus limit over rowBudget. It skips the probe in exactly the cases where page + 1 would be refused and page would not. The tool always sends a limit, so the planner's default-page arms are never reached. A page that was itself over the window was refused before this PR and is refused the same way now. Where the probe is skipped, truncated comes from the door's counted hasMore. On the HTTP door that is findData's counted arm. On the stdio door it is the new count below. resolveQueryReadLimits() runs inside the handler's try, the same reader deleteRecordsCap already uses, so a misconfigured variable surfaces as the door's error, as it does on the data door. The pin with OS_DATA_MAX_PAGE_SIZE equal to the page covers both doors: no probe is sent, a capped page is flagged and a whole page is not.
  • The stdio bridge's page facts: right. A paged read now runs engine.count(object, { where }, { context }). I read the count path at origin/main (engine-count-aggregate.ts): mergeReadContext takes the third argument's context, and the read filters are applied through the middleware chain on the count AST, as for find. So the count runs as the caller, under the same where, after the exposure, body-hash and sort refusals the read already passed. total is the match total, and hasMore is true when offset plus the rows served is below the count, which is findData's formula. If the count throws, total is omitted and hasMore is answered from the page alone. That is the data door's $count=false arm (a full page here answers hasMore: true; the door tests for exactly limit rows, and the two agree because a page cannot exceed its limit). An unpaged read keeps total: records.length, gains hasMore: false, and runs no count. Before this PR, a capped stdio page answered total equal to the page length with no hasMore. The only change to stdio total is that a paged read now reports a counted number, or none. hasMore is a new member.
  • The tool description: right. It now says the answer is one page of at most limit rows, that a truncated page must not be summed, counted or ranked as if whole, and to read on with offset or use aggregate_records "where it is offered". That hedge is correct: aggregate_records is registered only when the bridge has aggregate.
  • Built entry of @objectstack/mcp: nothing removed, renamed or narrowed. The exports map has only .. queryPageProbeFits and servedQueryPage are module-private. McpDataBridge.query keeps its signature and its Promise of unknown return. createStdioDataBridge keeps its signature. The answer body is untyped, and the claim's reading holds: the spec types only the source block of this result (object-query-source.zod.ts), so no spec type changes. Both bridge.query callers in delete_records read rows only, never total or hasMore. No input a caller could send before is refused now.
  • SQL push-down: no finding. The diff adds no id materialisation and no in-app join. The new stdio read is an engine count under the caller's where, which the driver runs as a count. The HTTP door already counts in findData, so it gains no read. The probe adds one row to the page read. The cost noted in the PR body's Acceptance notes is real: on stdio, delete_records' selection reads go through the same query member, so they also run the count. A full filter selection is then counted twice, once by query and once by the existing aggregate count. That is one extra count per stdio delete call, with no materialisation. It is acceptable as declared.
  • The helper move d85434872f..c56f66f4ef: a pure move. Its diff is 20 lines out and the same 20 lines in. withDelegationNotice moves below the two new helpers, and no line changes. So the PR body's readings at d85434872f hold for this head's code.

Findings:

  • N1 (nit): where the door answers a page-local total, it now counts the probe row. Two paths answer a total that was not counted. One is the callData('query') engine fallback when no protocol service is registered (action-execution.ts, total: all.length). The other is findData's count-failure degrade (pageOffset + records.length). On a capped page, both now answer total as one more than the rows served, beside truncated: true. Before this PR, they answered the page length with no flag. Neither number is a count, and the new answer is no less true: it is still a lower bound, and the flag now says the page is partial. But servedQueryPage restates hasMore from the probe and leaves total alone, and neither the PR body nor the changeset says so. No contract effect.
  • N2 (nit): no pin shows that the stdio count carries the caller's filter. The counted-total pin calls bridge.query(OBJECT, { limit: 3 }) and asserts count was called with {}. If the count dropped where, all 11 pins would stay green, and ablation A3 does not cover that mutation. The code is right today, as read above. A pin with a where would hold the changeset's "counted under the same filter" sentence.
  • N3 (nit): one corner flags a page that may be whole. When the read window refuses the probe and the stdio count also fails, hasMore comes from the page alone. So an exactly-full last page answers truncated: true. The description says the flag means "more records match". The error is in the safe direction, because it only discourages summing. It is reachable only where both conditions hold.
  • N4 (nit): the MCP tools page does not name the new member. content/docs/ai/connect-mcp.mdx:272 says list queries "are capped at 50 rows per page by default". It does not say that a capped page now answers truncated: true. The Docs Drift Check confirms that no hand-written page names the member. Prose only.

② Semver level

  • Changeset .changeset/35138-query-records-truncated.md: right. It bumps @objectstack/mcp at patch. That is the only published package the diff moves; the tests are not published. AGENTS.md Post-Task Checklist item 3 says that Metadata-protocol: none takes patch, and that a non-protocol widening ships patch. CI Check Changeset succeeded on this head.
  • Clause-②: yes (widening): right. It is line-initial in both the PR body and the changeset, and the arm is from the closed pair. An answer member present only when true, a new hasMore on the stdio answer, and a counted stdio total in place of a page length are additions and corrections. No accepted input is refused, and no member is removed or renamed. The claim 6975089907 and amendment 6975318215 declared Clause-②: yes for PR 1.
  • Metadata-protocol: none: right. No spec key, accepted value or metadata type is added. The result type stays local to packages/mcp.
  • Changeset prose, checked against the diff: right.
    • "asks for one row more than the page; when that row comes back, it serves the page and adds truncated: true … present only when true … exactly limit rows included, is unchanged": this matches servedQueryPage, the A1 and A2 ablations and the exact-limit pins.
    • "tells a model not to sum, count or rank a truncated page … read on with offset or use aggregate_records for totals": this matches the description text. The description also adds "where it is offered".
    • "a paged read is counted under the same filter, as the caller … Before, a capped stdio page answered total equal to the page length. If the count fails, total is left out and is never estimated": true. The filter half is unpinned (N2).
    • "When the host's read window … would refuse the extra row, the page is read as asked, and the door's counted hasMore decides truncated": true, as read in ①.
  • The PR body cites readings at the pre-move head d85434872f. The move is pure (①), so the readings carry over to this head's code. The changeset is the same file at both heads.

③ Boundary flags

  • open_questions: []. Nothing to answer.
  • Deviation, the probe is conditional, not unconditional: answered and right. It is a measured correction of W0's "from a limit+1 probe". Without it, a host with OS_DATA_MAX_PAGE_SIZE equal to the MCP page would refuse every full-page read. The fallback is sound (①).
  • Deviation, three pre-existing test files changed: answered.
    • The two preservation pins (unknown-argument-keys, 3 to 4; mcp-server-runtime.http, 5 to 6) assert the limit the bridge receives. The page served is unchanged, and the new pins assert it.
    • The stdio engine-read census gains count(object): 1. That is the new site, and the comment beside it says what it reads: a number, under the where the earlier refusals judged.
  • Deviation, the NOT-MEASURED gate check:dual-build-cjs-loads (exit 3, needs every package's dist): answered. CI Lint · repo & tooling gates, which carries it, succeeded on this head.
  • Deviation, the helper move after an overlap with feat(mcp): query_records and get_record name the fields field-level security withheld from the caller #35179: answered. The move is pure (①). The dev reports overlap-check clean against feat(mcp): query_records and get_record name the fields field-level security withheld from the caller #35179 and feat(mcp): aggregate_records returns select groups in declared option order and names a fixed amount's currency #35186 at this head. The merge queue re-tests the merge result.
  • Deviation, the PR body is not updated after the move: process only, answered in ②.
  • Out-of-scope note, findData's page-local total when engine.count throws: answered. It is a deliberate degrade, documented at protocol-data-crud.ts ("degrade to a page-local total rather than failing the list"), outside this PR's file surface. It is recorded in the PR's Acceptance notes, and not filing it is right under the filing gate: no defect with a public repro. Its interaction with the probe is N1.
  • Acceptance note, every paged stdio bridge.query now runs one count, delete_records included: answered in ① under SQL push-down.
  • Process notes: the PR is a draft. Author: objectstack-fleet[bot] (relay), assignee os-warren, so no extra author note is owed. All four findings are nits, so this is the final round unless the head moves for a reason other than prose. The seat must confirm that the 11 in-progress runs finish green on this head before landing (①).

Implemented-by: claude/issue-35138-capped
Reviewed-by: session_01JQwxbYRqkDAGuse5Wqbohi

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi

Final head for L1 · 2026-11-18T11:37Z

Head-sha: c56f66f4ef · all check-runs success or skipped (37 success, 16 skipped, 0 red; all ten Test Core shards and the four lint and type-check runs the record saw in progress finished green) · NOT governed, +292 / −11. Delivers #35138 PR 1 (a capped query_records page says truncated: true; the stdio door counts its total), so the PR says Refs #35138, not Fixes.
Owed: L1 (first read; area o1-B requests it from L1-a). Clause-②: yes (widening), Metadata-protocol: none: the TIER_DEFAULT contract record 6977056472 at this head is PASS (declaration face). Nits N1 to N4 stay nits: an uncounted fallback total now includes the probe row, no stdio count pin with a where, one safe-side corner flags a whole page, and the MCP tools page does not name truncated. Inputs: claim 6975089907, amendment 1 6975318215, dev report 6976907593, brief 6976945886.
Landing order: this PR lands first, before #35186 (L1 ACCEPT 6977440192) and before #35145 PR 1, because it owns truncated on query_records.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbXKtHccbeakAgquNs9

L1 review (#35138, PR 1) · 2026-11-18T11:42Z

L1: ACCEPT
Head-sha: c56f66f
Read: the full diff at this head against merge base 7d8dcf6 (7 files, +292/−11), with claim 6975089907, amendment 1 6975318215 (PR 1's surface), the final-head note 6977464019 and contract record 6977056472.

Fixes vs Part of. This is PR 1 of the W0 plan. The body says Refs #35138, with no closing keyword in the body or the changeset, so a merge does not close the card. As on #35186, the checklist's form is Part of, and Refs has the same effect.

Claim file surface. Amendment 1 gives PR 1 mcp-http-tools.ts (the query_records handler), stdio-data-bridge.ts (page facts), their tests and one changeset.

  • The source hunks are the handler, two module-private helpers above withDelegationNotice, and the stdio query return.
  • Tests: query-records-truncated.test.ts is new and covers both files. mcp-http-tools.unknown-argument-keys.test.ts is the handler's test. stdio-data-bridge.stored-metadata-body.test.ts holds the bridge's engine-read census.
  • mcp-server-runtime.http.test.ts is named for the runtime, but the one line changed asserts the limit this handler hands the bridge (5 to 6). I read it as a test of the handler, so it is inside "their tests" (N1).

Each changeset sentence against the diff. The changeset is new, and main has no .changeset/35138-query*. It bumps @objectstack/mcp at patch.

  • "Asks for one row more … serves the page and adds truncated: true; present only when true; exactly limit rows unchanged": servedQueryPage slices to page and spreads truncated only when records.length > page. Where the door answers hasMore, it is restated from the probe, because the door counted it against the widened read. A non-{records} shape is served as it came. Exact-limit pins cover both doors.
  • The description sentence: it is added to the tool description word for word.
  • "The stdio door … counted under the same filter, as the caller": engine.count(object, { where: opts.where }, { context }) runs after the same exposure, relation-target, stored-body, hash and sort refusals as find, with the same where and the same context. hasMore is offset + records.length < counted.
  • "If the count fails, total is left out": the catch returns no total, with hasMore taken from the page alone.
  • "Before, a capped stdio page answered total equal to the page length": this is the removed line.
  • The read window: queryPageProbeFits skips the probe where page + 1 would pass OS_DATA_MAX_PAGE_SIZE, or where offset + page + 1 would pass OS_DATA_QUERY_ROW_BUDGET. In that case truncated follows the door's counted hasMore. Each door has a pin for this.
  • An unpaged stdio read (no limit, no offset) runs no count and answers its length as the total with hasMore: false, as the pin says. The tool always sends a limit, so through the tool every stdio page is counted.

Tests. The new file holds four cases per door: capped, exact limit, last page, and probe refused. It also holds three stdio page-fact cases: counted total, failed count, and unpaged. The two preservation pins move by the probe row only. The census gains count(object): 1, with what it reads stated beside it. The record names the ablations A1 to A3.

Clause-②: yes (widening). TIER_DEFAULT record 6977056472 is PASS on this same head, and its N1 to N4 are nits. I agree with its N2: no pin carries a where into the stdio count. The code passes it today. I add no ask.

Governance. check-governed-merges.mjs --pr 35185: NOT governed, 0 of 7 paths on the register, 303 changed lines.

CI at this head, from check-runs: 37 success and 16 skipped, with none failed or in progress. The PR is mergeable clean.

Must-fix

None.

Should-fix

None.

Notes

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbYRqkDAGuse5Wqbohi

Landing · 2026-11-18T11:43Z

Probe Reading
check-governed-merges.mjs --pr 35185 NOT governed · +292 / −11, 0 of 7 paths on the register, Clause-②: yes (widening) (claim 6975089907, amendment 1 6975318215)
Contract review (条款②) TIER_DEFAULT record 6977056472 at c56f66f4ef: PASS (declaration face; nits N1 to N4 only)
Head / review c56f66f4ef · L1-a ACCEPT 6977544661 at this head (first L1; no must-fix, no should-fix), the review of record · all check-runs success or skipped (37 success, 16 skipped, 0 red)
Freshness K = 3, merges cleanly into origin/main c9b3f7a10e; overlap-check.mjs clean (#35186 and #35179 share files and merge cleanly)

Open findings: record nits N1 (an uncounted fallback total includes the probe row), N2 (no stdio count pin with a where), N3 (one safe-side corner flags a whole page), N4 (the MCP tools page does not name truncated); L1 note N1 (mcp-server-runtime.http.test.ts read as one of the handler's tests under amendment 1, and the area reads it the same way).

State: ready + auto-merge armed by area o1-B (lease o1-B, claim 6975089907). This is #35138 PR 1 and says Refs #35138, so the card stays open with pm:dispatched until its last row lands. It lands before #35186 and before #35145 PR 1.

Dev-effort: medium · Rounds: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants